package top.techqi.app.mcs51

import android.app.Application
import top.techqi.core.tool.life.GroundMonitor
import top.techqi.core.tool.life.LifecycleStat
import top.techqi.core.tool.xlog.impl.FileLog
import top.techqi.core.util.LogUtil
import java.io.File

class Mcs51App : Application() {
    override fun onCreate() {
        super.onCreate()
        initCoreToolUtils()
    }

    private fun initCoreToolUtils() {
        if (BuildConfig.DEBUG) {
            LogUtil += FileLog(File(this.externalCacheDir, "filelog"))
        }

        GroundMonitor.init(this)
        if (BuildConfig.DEBUG) {
            LifecycleStat.init(this)
        }
    }
}
